package com.lfy.domain;

import com.lfy.modules.disk.domain.vo.ShareFilePwdVO;
import com.lfy.encrypt.AESUtil;
import com.lfy.modules.common.utils.JsonUtils;

import java.io.ByteArrayOutputStream;
import java.util.Base64;
import java.util.zip.GZIPOutputStream;

public class test {
    public static void main(String[] args) {

    }

    public static String gzipCompressJson(String jsonString) throws Exception {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        try (GZIPOutputStream gzipOutputStream = new GZIPOutputStream(outputStream)) {
            gzipOutputStream.write(jsonString.getBytes("UTF-8"));
        }
        return Base64.getEncoder().encodeToString(outputStream.toByteArray());
    }
}
